package com.bbs.eventListener;

import com.bbs.dto.PostPublishedDTO;
import com.bbs.event.PostPublishedEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

@Service
public class PostPublishedListener {

    @EventListener()
    //将帖子发布的信息发送给粉丝
    public void sendToFans(PostPublishedEvent postPublishedEvent){

        PostPublishedDTO postPublishedDTO = postPublishedEvent.getPostPublishedDTO();
        //帖子id
        Long postId = postPublishedDTO.getPostId();
        //用户id
        Long userId = postPublishedDTO.getUserId();
        //获取粉丝

        //发送给粉丝TODO
    }
    //帖子发布成功
    @EventListener()
    public void Reward(PostPublishedEvent postPublishedEvent){
        PostPublishedDTO postPublishedDTO = postPublishedEvent.getPostPublishedDTO();
    }
}
